#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <vector>

using namespace std;

struct ListNode {
    int val;
    ListNode* next;
    ListNode(int x) : val(x), next(NULL) {}
};

struct TreeNode {
    int val;
    TreeNode* left;
    TreeNode* right;
    TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};

class Solution {
    int pos = 0, i = 0, ret = 0;

    void getKMax(TreeNode* r) {
        if (r != NULL) {
            getKMax(r->right);
            if (++i == pos) ret = r->val;
            getKMax(r->left);
        }
    }

   public:
    int kthLargest(TreeNode* root, int k) {
        pos = k;
        getKMax(root);
        return ret;
    }
};

int main() {
    cout << "Hello, World!";
    // Solution()
    return 0;
}